//
//  HeadTitleView.m
//  carowner
//
//  Created by apple on 2019/5/24.
//  Copyright © 2019 ggj. All rights reserved.
//

#import "HeadTitleView.h"

@implementation HeadTitleView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self.backgroundColor = [UIColor whiteColor];
        
        UIView * uiView = [[UIView alloc]init];
        uiView.backgroundColor = color2;
        _tvLabel = [[UILabel alloc] init];
        _tvLabel.textColor = normal_text_color;
        _tvLabel.font = btnFont;
        [self addSubview:uiView];
        [self addSubview:_tvLabel];
        [uiView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self).offset(20);
            make.size.mas_equalTo(CGSizeMake(4, 20));
        }];
        
        [_tvLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self);
            make.height.mas_equalTo(40);
            make.left.equalTo(uiView.mas_right).offset(10);
        }];
    }
    return self;
}

@end
